# 产品包基础镜像,做为tomcat等容器的sidecar运行.
#FROM d-hub.jcinfo.com/library/busybox
FROM harbor.jcdiq.cn/library/alpine:3.8

#更新Alpine的软件源为国内（清华大学）的站点，因为从默认官源拉取实在太慢了。。。
#RUN echo "https://mirror.tuna.tsinghua.edu.cn/alpine/v3.4/main/" > /etc/apk/repositories
#RUN set -eux && sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories

#RUN apk update \
#        && apk upgrade \
#        && apk add --no-cache bash \
#        bash-doc \
#        bash-completion \
#        zip \
#        && rm -rf /var/cache/apk/*
#RUN zip --help
# 定义一个变量APP_HOME
ENV APP_HOME=/app

RUN mkdir -p ${APP_HOME}/work && mkdir -p ${APP_HOME}/apps
# 把宿主机当前目录下的start.sh 复制到镜像中的APP_HOME目录下
ADD start.sh ${APP_HOME}/start.sh
# 修改start.sh 的权限
RUN chmod +x ${APP_HOME}/start.sh
# 指定容器运行时的当前目录
WORKDIR ${APP_HOME}/work
# APP_HOME/work 目录可以做为volume 映射
VOLUME ${APP_HOME}/apps

# 执行start.sh
# ENTRYPOINT ["../start.sh"]
CMD ["../start.sh"]
